#ifndef _EXT_INODE_INFO_
#define _EXT_INODE_INFO_
#include <linux/types.h>
#include <linux/rwsem.h>
#include <linux/timer.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/blkdev.h>
#include <linux/ext3_fs.h>
#include <linux/ext3_fs_i.h>
#include <linux/ext3_jbd.h>
#include <linux/buffer_head.h>
#include <linux/journal-head.h>

extern get_block_t* ext3_get_block_fn;
extern int (*ext3_mark_inode_dirty_fn)(handle_t*, struct inode*);
typedef int (*ext3_get_inode_loc_t) (struct inode*, struct ext3_iloc*);
extern ext3_get_inode_loc_t ext3_get_inode_loc_fn;
void set_ext3_get_inode_loc(unsigned long);

typedef int (*ext3_mark_inode_dirty_t)(handle_t*, struct inode*);

struct jbd2_inode {
	void* space1[3];
	struct list_head space2;
	unsigned long space3;
};

struct ext4_iloc {
	struct buffer_head *bh;
	unsigned long offset;
	unsigned int block_group;
};

struct ext4_inode_info {
	__u32 space1[16];
	unsigned long long space2;
	__u32 space3;
	unsigned int space4;
	unsigned long space5;
	struct list_head space6;
	loff_t i_disksize;
	struct rw_semaphore space7;
	struct inode vfs_inode; //space8
	struct jbd2_inode space9;
	unsigned long long space10;
	__u32 space11[3];
	struct timespec space12;
	struct list_head space13;
	spinlock_t space14;
	unsigned int space15;
	unsigned int space16[3];
	unsigned short space17;
	sector_t space18;
	int space19;
	__u16 space20;
	spinlock_t space21;
	struct list_head space22;
	spinlock_t space23;
	void* space24;
	tid_t space25[2];
};

typedef int (*ext4_mark_inode_dirty_t)(handle_t*, struct inode*);
extern ext4_mark_inode_dirty_t ext4_mark_inode_dirty_fn;
#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
typedef int (*ext4_get_inode_loc_t) (struct inode*, struct ext4_iloc*);
extern ext4_get_inode_loc_t ext4_get_inode_loc_fn;
void set_ext4_get_inode_loc(unsigned long);
#endif
